<!-- 列表显示头 开始 -->
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="STYLE1" bgcolor="b5d6e6">
  <tr>
    <td colspan="3" align="left" background='<%=$urr+"skin/images/bg.gif"%>'><img src='<%=$urr+"skin/icon/list.gif"%>' width="16" height="16" />
      <span class="STYLE3"><%=@titles %></span></td>
  </tr>
</table>
<!-- 列表查询项 开始 -->
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="STYLE1">
  <% form_for :level, :url => { :action => "list" } do |f| %>
    <tr>
      <td height="30" align="left">
        <%= f.label "级别名称" %>
        <%= f.text_field :name%>
        <%= f.submit '搜索' %>
      </td>
    </tr>
  <% end %>
</table>
<!-- 列表操作项 开始 -->
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="STYLE1">
  <tr>
    <td height="30" align="right">
      <%= button_to "增加级别", :controller => "level",:action => "new" %>
    </td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6"  class="STYLE1">
  <tr>
    <td width="15%" height="22" align="center" bgcolor="#33FFFF">级别名称</td>
    <td height="22" align="center" bgcolor="#33FFFF">域名标识</td>
    <td height="22" align="center" bgcolor="#33FFFF">是否主站</td>
    <td height="22" align="center" bgcolor="#33FFFF">栏目级别</td>
    <td height="22" align="center" bgcolor="#33FFFF">资源级别</td>
    <td  height="22" align="center" bgcolor="#33FFFF">操作</td>
  </tr>

  <% @levels.each_with_index do |level,index| %>
  <%
    bg_col = "#CCFFCC"
    unless index%2 == 0
      bg_col = "#FFCCCC"
    end
  %>
    <tr>
      <td align="center" bgcolor=<%= bg_col %>><%=h level.name %></td>
      <td align="center" bgcolor=<%= bg_col %>><%=h level.host %></td>
      <td align="center" bgcolor=<%= bg_col %>>
        <%  if level.is_default %>
          <%= "主站" %>
        <%  else %>
          <%= "非主站" %>
        <% end %>
      </td>
      <td align="center" bgcolor=<%= bg_col %>><%=h level.col_level %></td>
      <td align="center" bgcolor=<%= bg_col %>><%=h level.res_level %></td>
      <td align="center" bgcolor=<%= bg_col %>>
        <%= link_to '查看',  :controller => "level", :action => "show", :id => level.id %>
        <%= link_to '编辑',  :controller => "level", :action => "edit", :id => level.id  %>
      </td>
    </tr>
  <% end %>
</table>

<!-- 列表分页项 开始 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr align="center">
    <td align="center" height="40">
      <%= will_paginate @levels, :style => 'font-size: small'%>
    </td>
  </tr>
</table>
<!-- 列表分页项 结束 -->